<extend name="common:base" />
<block name="body">
    <div class="wrapper wrapper-content animated fadeInRight" style="min-height: 250px;">
        <!-- /.row -->
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        添加广告
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-12">
                                <form role="form" class="ajaxform form-horizontal" action="{:U('admin/ads/save')}"  method="post">
                                    <div class="form-group ">
                                        <label  class="col-sm-2 control-label">标题</label>
                                        <div class="col-sm-10">
                                            <input class="form-control"  type="text" name="title" style="max-width:300px;">
                                        </div>
                                    </div>

                                    <div class="form-group ">
                                        <label  class="col-sm-2 control-label">位置</label>
                                        <div class="col-sm-10">
                                            <input class="form-control"  type="text" name="position" style="max-width:300px;">
                                        </div>
                                    </div>

                                    <div class="form-group ">
                                        <label  class="col-sm-2 control-label">位置标识(英文)</label>
                                        <div class="col-sm-10">
                                            <input class="form-control"  type="text" name="position_sn" style="max-width:300px;">
                                        </div>
                                    </div>

                                    <div class="form-group ">
                                        <label  class="col-sm-2 control-label">链接</label>
                                        <div class="col-sm-10">
                                            <input class="form-control"  type="text" name="url" style="max-width:300px;">
                                        </div>
                                    </div>

                                    <div class="form-group ">
                                        <label  class="col-sm-2 control-label">排序</label>
                                        <div class="col-sm-10">
                                            <input class="form-control"  type="text" name="sortrank" style="max-width:300px;">
                                        </div>
                                    </div>

                                    <div class="form-group ">
                                        <label  class="col-sm-2 control-label">广告图片(640*430)</label>
                                        <div class="col-sm-10">
                                            <div id="uploader-demo">
                                                <!--用来存放item-->
                                                <div class="file-item">
                                                    <img class="img" src="{$ads.img}" onerror="this.src='__PUBLIC__/admin/img/no_img.jpg'" style="height: 100px;" >
                                                    <div class="info" style="display:none;"></div>
                                                    <input type="hidden" class="img_path" name="img" value="{$ads.img}">
                                                </div>
                                                <div id="filePicker">选择图片</div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <div class="col-sm-offset-2 col-sm-10">
                                            <button type="submit" class="btn btn-w-m btn-info"><i class="fa fa-check"></i>&nbsp;提交</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <!-- /.col-lg-6 (nested) -->
                            <div class="col-lg-6">

                            </div>
                            <!-- /.col-lg-6 (nested) -->
                        </div>
                        <!-- /.row (nested) -->
                    </div>
                    <!-- /.panel-body -->
                </div>
                <!-- /.panel -->
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <!-- /.row -->
    </div>

</block>
<block name="footer">
    <script type="text/javascript" src="__PUBLIC__/js/webuploader/webuploader.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/webuploader/upload_single.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/datepicker/WdatePicker.js"></script>
    <link rel="stylesheet" href="__PUBLIC__/js/webuploader/webuploader.css">
    <link rel="stylesheet" href="__PUBLIC__/js/webuploader/demo.css">
    <script>
        upload_single('#filePicker','file-item','img_path', '{:U("Common/upload")}','150','100')
    </script>
</block>
